import BaseService from "../BaseService";

class FormViewService extends BaseService {

  queryList(params) {
    return this.getAction(this.getModulePath() + `/queryList`, params);
  }


  queryByPublishId(params) {
    return this.getAction(this.getModulePath() + `/queryByPublishId`, params);
  }


  getInitMasterData(params) {
    return this.getAction(this.getModulePath() + `/getInitMasterData`, params);
  }
  queryTreeDataByViewId(params) {
    return this.postAction(this.getModulePath() + `/queryTreeDataByViewId`, params);
  }
  queryPageDataByViewId(params) {
    return this.postAction(this.getModulePath() + `/queryPageDataByViewId`, params);
  }


  queryDataShowNameByViewId(params) {
    return this.getAction(this.getModulePath() + `/queryDataShowNameByViewId`, params);
  }

  //查询一条数据
  queryOneDataByViewId(params) {
    return this.getAction(this.getModulePath() + `/queryOneDataByViewId`, params);
  }


  queryByViewId(params) {
    return this.postAction(this.getModulePath() + `/queryByViewId`, params);
  }

  queryPage(params) {
    return this.getAction(this.getBaseUrl() + `/form/formViewPub/queryPage`, params);
  }
  //定版视图分页查询
  queryPubPage(params) {
    return this.getAction(this.getModulePath() + `/queryPubPage`, params);
  }

  delectById(params) {
    return this.getAction(this.getModulePath() + `/delectById`, params);
  }

  queryById(params){
    return this.getAction(this.getModulePath() + `/queryById`, params);
  }
  queryformViewPubById(params){
    return this.getAction(this.getModulePath() + `/queryformViewPubById`, params);
  }

  finalAutogeneral(params){
    return this.postAction(this.getModulePath() + `/finalAutogeneral`, params);
  }
  
  save(params) {
    return this.postAction(this.getModulePath() + `/save`, params);
  }

  checkSave(params) {
    return this.postAction(this.getModulePath() + `/checkSave`, params);
  }

  /**
   * 描述:获取host地址
   * @returns {string}
   */
  getBaseUrl() {
    return this.serviceConfig.getBaseUrl("mdm");
  }
  /**
   * 描述:获取模块地址
   * @returns {string}
   */
  getModulePath() {
    return "/form/formView";
  }
}

export default new FormViewService();
